package com.freewater.springboot.demo.spel.types;

import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

import java.util.Date;

public class Main {
    public static void main(String[] args) {
        ExpressionParser parser = new SpelExpressionParser();

        Class<?> dateClass = parser.parseExpression("T(java.util.Date)").getValue(Class.class);
        System.out.println(Date.class.equals(dateClass));

        Class<?> stringClass = parser.parseExpression("T(String)").getValue(Class.class);
        System.out.println(String.class.equals(stringClass));

        boolean trueValue = Boolean.TRUE.equals(parser.parseExpression(
                        "T(java.math.RoundingMode).CEILING < T(java.math.RoundingMode).FLOOR")
                .getValue(Boolean.class));
        System.out.println(trueValue);
    }
}
